export function isObject(obj) {
  return Object.prototype.toString.call(obj) === "[object Object]";
}
//是否是人工忽略
export function isPerIgnore(status) {
  return status == 121 ? true : false;
}

export function filterData(arr, value) {
  let itemArr = arr.filter((item) => {
    return item.value == value;
  });
  return (itemArr.length > 0 && itemArr[0].label) || "";
}

/**
 * 根据字段分类和字典值，获取字典label
 * @param {number | array} dicType
 * @param {string} dicVal
 * @param {string} propName 匹配哪个字段
 * @returns
 */
//获取字典匹配的label值
export function getDicLabel(dicType, dicVal, propName) {
  let dicData = [];
  if (Array.isArray(dicType)) {
    dicData = dicType.filter((item) => {
      return (item[propName] || item.value) == dicVal;
    });
  } else {
    dicData = store.state.dictionary[dicType].filter((item) => {
      return (item[propName] || item.value) == dicVal;
    });
  }
  return (dicData.length > 0 && dicData[0].label) || "";
}
